Repository navigation
feat(packs): independent packs skeleton, boundary gates and TypeScript pack conformance (ADR-0069) - #647
Merged
Conversation
…t pack conformance (ADR-0069) ADR-0069 records the ruling on independent packs: Metamodel N.M names the default bundle only; an independent pack lives in packs/<name>/, carries its own version and changelog, is carried only by the ports its pack.json lists, and is never in expected-registry.json; core never depends on a pack; the provider contract is covered by core's package version. GOVERNANCE.md, extending-with-providers.md, CONFORMANCE.md, compatibility-policy.md and RELEASING.md gain the matching paragraphs. RELEASING.md's stale single-package npm patch section is replaced, and the 1.3.0 changelog line says 13 publish candidates. The skeleton, with no pack in it: - packs/*/typescript joins the root Bun workspace; the root build and typecheck scripts (and the pre-push hook, ci-local.sh and integration-test.sh, which call them) name core's workspace directories instead of --filter '*'. - scripts/check-pack-boundary.ts: core names no pack coordinate or packs/ path, no pack id or pinned type is in the bundle, and core's release gates do not see a planted pack package. - scripts/check-pack-manifests.ts: each pack.json is well formed and agrees with its ports' native manifests. - a packs lane in ci-local.sh (blocking for a pack's own change, a named non-failing SKIP canary on core changes), the lane-map row, the hosted ts matrix entry, packs/README.md and a MAINTAINERS.md area. Pack conformance in TypeScript: runCorpus, a corpus-root entry point in @metaobjectsdev/conformance; createTsAdapter(extraProviders) in the metadata test adapter; scripts/pack-vocabulary.ts (pinned vocabulary plus the leaves-core-alone check) and scripts/pack-conformance.ts. No vocabulary, metamodelVersion, expected-registry.json or package version changes.
A packs job on the self-hosted runner, gated on the ts port and mapped in ci-ports-to-run.sh so a red packs lane on main is re-run by the known-green selection. The blocking/canary decision diffs against the push's before SHA; nightly and dispatch runs treat every pack as a canary.
- pack_is_blocking captures the changed-path list before grepping, so pipefail plus grep -q can no longer turn a pack's own change into a non-blocking canary. - the leaves-core-alone check fails a child rule with a lower bound added to a type the pack does not own (the registry already refuses a required projected attribute). - runCorpus applies requireProviders before skipping docs-only and contract-only scenarios, does not pass a corpus with nothing runnable, and reports an adapter throw as that scenario's failure. - check-pack-manifests accepts caret, tilde, ~= and bounded intervals. - the live build and typecheck instructions say bun run build / bun run typecheck instead of --filter '*'. - ADR-0069 and the lane map say the pack-only selection holds under --affected; the hosted workflows select by port.
- conformance: runAndClassify and loadErrorCodes are the shared step; the core metadata conformance test and runCorpus both call them, so the classification lives in one place. - lib/packs: typescriptPackNames and packNamesFromArgs replace the copies in pack-vocabulary and pack-conformance. - pack-vocabulary returns core problems and the committed pin directly instead of re-deriving them by message prefix and a second read. - ci-local: step_canary is a step mode (timed, list-only aware); the change's path list is computed once per run, not once per pack. - check-pack-boundary parses the manifests once and builds each id regex once; the test no longer repeats the full-repo scan the gate runs. - check-pack-manifests dispatches native checks from a per-port table.
# Conflicts: # docs/compatibility-policy.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
metamodelVersionandexpected-registry.json), plus matching paragraphs in GOVERNANCE.md, the providers guide, docs/CONFORMANCE.md, the compatibility policy (provider contract now covered by core's package version) and RELEASING.md; also fixes RELEASING's stale "Isolated patch" section and the CHANGELOG 1.3.0 line that said 14 lockstep packages (it is 13), and adds apacks/MAINTAINERS entry.packs/skeleton so pack work cannot disturb core: the root workspace globspacks/*/typescriptwhile the rootbuild/typecheckscripts name core's workspace directories only; newscripts/check-pack-boundary.tsandscripts/check-pack-manifests.tsgates (ingates) fail if core ever names a pack, a pack's vocabulary enters the default bundle, or release tooling would publish one, and hold eachpack.jsonto its ports' native manifests; a newpackslane inci-local.sh(wired intolocal-ci.yml,pr-ci.ymland the lane map) blocks on a pack's own change and reports a pack a core change broke as a named non-failing canary SKIP.pack-vocabulary.tspins the registry rows a pack adds (expected-vocabulary.json) and fails any that change the bundle's,pack-conformance.tsruns a pack's load fixtures through a new corpus-root entry pointrunCorpus/runAndClassify/loadErrorCodesexported from@metaobjectsdev/conformance(withrequireProvidersforcing each scenario to name the pack), andcreateTsAdaptergains additive-only extra providers so a pack cannot stand in for a bundled one.No pack content ships and nothing published changes: no pack exists under
packs/, core vocabulary,metamodelVersionandexpected-registry.jsonare untouched, and the lane passes with a note while that holds.Validation
Risk Assessment
✅ Low: Change is tooling, CI and docs only: it adds no packs, publishes nothing, leaves core vocabulary, metamodelVersion and expected-registry.json untouched, and every required item in the intent is present and wired. The pack boundary and manifest gates pass on the current tree, and the scoped bun path filters match core's packages. I did not run the tests, as instructed.
Testing
The configured test command (
scripts/ci-local.sh --affected --strict-toolchains) already passed at the target commit as broad regression. On top of it I drove the change's runtime surface — the packs CI lane and the boundary/manifest/vocabulary/conformance CLIs — live, on the untouched tree and against a disposablepacks/smokepack I built in the worktree from the fixture corpus and removed afterwards (bun.lock churn restored via git checkout, worktree verified clean). The skeleton lane passes with its no-pack note; a complete throwaway pack goes green end-to-end (pin written, its load fixture runs through the TypeScript adapter with the pack composed in, manifests agree, and the lane's blocking 'pack smoke' step passes including the pack's own tsc typecheck); and every guard added by this change refuses its violation with the exact ADR message: core naming a pack coordinate, manifest version drift, a pack mutating a bundle-declared row ('does not leave core alone — changed: default object'), and a pack corpus scenario that does not name the pack. No UI surface is involved, so there are no screenshots; evidence is CLI transcripts in the evidence directory.scripts/ci-local.sh --only packson the untouched tree reports 'no independent pack with a TypeScript port — nothing to check' and exits 0; `bun scripts/check-…Evidence: S1: packs lane on untouched skeleton
── packs: no independent pack with a TypeScript port under packs/ — nothing to check ── ... LOCAL CI PASSEDEvidence: S1: boundary + manifests gates on untouched skeleton
pack boundary: OK (0 pack(s); core names none, the bundle holds none, the release tooling sees none) | pack manifests: OK (0 packs)Evidence: S2: vocabulary pin missing → --write → green
✖ fixtures/expected-vocabulary.json is missing — run: bun scripts/pack-vocabulary.ts smoke --write → 'wrote fixtures/expected-vocabulary.json' → 'pack smoke: vocabulary pinned, leaves core alone'Evidence: S2: pack conformance through the TS adapter
pack smoke: conformance 1 passEvidence: S2: full packs lane with the pack, blocking step
── ✓ packs: core build (5s) ── ✓ pack smoke (1s) ... LOCAL CI PASSEDEvidence: S3: boundary gate refuses core naming a pack
✖ server/typescript/packages/metadata/src/zz-smoke-violation.ts:1: core names a pack coordinate — core may never depend on a pack (exit 1; green again after removal)Evidence: S3: manifests gate refuses version drift
✖ packs/smoke/typescript/package.json: version is "0.2.0", pack.json says "0.1.0" (exit 1; green again after revert)Evidence: S3: vocabulary gate refuses a pack that mutates the bundle
✖ does not leave core alone — changed: default object (was "entity", now "value") (exit 1)Evidence: S3: pack corpus scenario must name the pack
✖ loads [fail]: providers.json must name "metaobjects-smoke" (it lists: metaobjects-core-types) (exit 1; exit 0 once the pack is named — see s3-conformance-providerless-fixed.txt)Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
scripts/lib/packs.ts:133- A half-authored pack directory (typescript/package.json present but pack.json not yet written) makesbun scripts/pack-conformance.ts <name>/pack-vocabulary.tsabort with a raw ENOENT stack trace from readPackManifest instead of a named problem message; check-pack-boundary's packsById tolerates this case, the two pack scripts do not. Observed only while building a throwaway fixture; no committed code path hits it today, and check-pack-manifests would flag the malformed pack first in CI.scripts/ci-local.sh --only packson the untouched tree reports 'no independent pack with a TypeScript port — nothing to check' and exits 0; `bun scripts/check-…scripts/ci-local.sh --affected --strict-toolchainsbaseline broad regression:scripts/ci-local.sh --affected --strict-toolchainspassed at the target commit (configured test command, not re-run)scripts/ci-local.sh --only packson the untouched skeleton — lane passes with the no-pack notebun scripts/check-pack-boundary.tsandbun scripts/check-pack-manifests.tson the untouched skeleton — both green, including the release-tooling scan that plants public pack packages in a scratch root and asserts publish-set / check-publish-intent / check-no-prerelease-versions never enumerate packs/disposablepacks/smokehappy path:bun scripts/pack-vocabulary.ts smoke(missing pin refused,--writepins it, re-check green 'vocabulary pinned, leaves core alone'),bun scripts/pack-conformance.ts smoke('1 pass' through the TS adapter composed with the pack's provider),bun scripts/check-pack-manifests.ts('OK (1 pack)'),bun scripts/check-pack-boundary.ts('OK (1 pack(s)...)')MO_CI_PACKS_BLOCKING=1 scripts/ci-local.sh --only packswith the pack present — core build ✓, blocking 'pack smoke' step ✓ (typecheck + vocabulary + conformance)adversarial: core file importing@metaobjectsdev/pack-smoke→ boundary gate exits 1 'core names a pack coordinate'; pack.json/package.json version drift → manifests gate exits 1 naming the disagreement; provider callingregistry.setDefaultSubType("object", "value")→ vocabulary gate exits 1 'does not leave core alone — changed: default object'; pack corpus scenario whose providers.json omits the pack → pack-conformance exits 1 'providers.json must name "metaobjects-smoke"', and passes once it names itcleanup verification: worktreegit statusclean after removing the throwaway pack and restoring bun.lock; boundary + manifests gates re-run green on the clean tree✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.